#include "MainForm.h"

using namespace Osp::Base;
using namespace Osp::Ui;
using namespace Osp::Ui::Controls;

MainForm::MainForm(void)
{
}

MainForm::~MainForm(void)
{
}

bool
MainForm::Initialize()
{
	// Construct an XML form
	Construct(L"IDF_MAINFORM");

	return true;
}

result
MainForm::OnInitializing(void)
{
	result r = E_SUCCESS;

	// hozzaadjuk a formunkhoz a fizikai gombok listenerjet
	this->AddKeyEventListener(*this);

	return r;
}

result
MainForm::OnTerminating(void)
{
	result r = E_SUCCESS;

	// TODO: Add your termination code here

	return r;
}

void
MainForm::OnKeyPressed(const Osp::Ui::Control& source, Osp::Ui::KeyCode keyCode)
{
	switch (keyCode)
	{
	case Osp::Ui::KEY_SIDE_UP:
		{
			MessageBox messageBox;
			messageBox.Construct(L"Eredmény", L"Hangerő növelve", MSGBOX_STYLE_NONE, 3000);
			int mr;
			messageBox.ShowAndWait(mr);
			AppLog("hangero novelese");
		}
		break;
	case Osp::Ui::KEY_SIDE_DOWN:
		{
			MessageBox messageBox;
			messageBox.Construct(L"Eredmény", L"Hangerő csökkentve", MSGBOX_STYLE_NONE, 3000);
			int mr;
			messageBox.ShowAndWait(mr);
			AppLog("hangero csokkentese");
		}
		break;
	case Osp::Ui::KEY_CAMERA:
		{
			MessageBox messageBox;
			messageBox.Construct(L"Eredmény", L"Kamera beizzítva", MSGBOX_STYLE_NONE, 3000);
			int mr;
			messageBox.ShowAndWait(mr);
			AppLog("kamera gomb");
		}
		break;
	default:
		break;
	}
}


